#!/usr/bin/perl 


use warnings;
use strict;

 checkParameter(\@ARGV);
	
open (HANDLE, $ARGV[0]) || die "can't opendir $ARGV[0]: $!";

my $energi=1000;	

while (defined(local $_= <HANDLE>) && ($energi > 0))
	{
 	  if (m/dG\s+=\s+\D\d+/) 
		{
		 chop $_;
		 s/^\s+|\s+$//g;
		 s/\s+/ /g;
		 my @line=split / /,$_;
		 $energi=$line[3]+0;
		}
		 
	}
	
	close (HANDLE);
 print "$energi \n";

		
	
sub checkParameter{
 my ($argv)=@_;
 
 	unless (exists($$argv[0]) )	{
		&usage();
	}

}

sub usage{

print "\tEjecution with this
\t$0 ct_file \n"; 
exit(0);

}
